file

abstract fun file(): String

Returns a string that represents an absolute or relative path to a file if the current input DOM element has the type attribute with the 'file' value. If this DOM element has the multiple attribute, returns string that represents the first of file paths. Returns an empty string if the element does not have a file selected.

Throws

when the type attribute value of the element is not 'file'

when this instance is closed


abstract fun file(filePaths: Array<String>)

Sets one or multiple string values that represent the path to a file. This method can be used only when the input DOM element with the type has the 'file' value.

Parameters

filePaths

the list of strings that represent the paths to the files

Throws

when one or more elements of the filePaths are empty or blank

when the type attribute value of the element is not 'file'

when this instance is closed